#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace cv;

int main1() {
	Mat src = imread("F:/images/lena.jpg");
	imshow("src", src);
	//points
	Point2i p(10, 10);
	Point2i p2(200, 200);
	Point2f p3(200, 200);
	Rect2i r(0, 0, 100, 100);
	bool b = p.inside(r);
	bool b2 = p2.inside(r);
	//scalar
	Scalar s(255, 255, 255);
	Scalar s2(10, 100, 255);
	Scalar s3(10);
	Scalar s4(10, 10);
	Scalar ss = s.mul(s2);
	//rect
	Size size(100, 100);
	Rect r1(0, 0, 100, 100);
	Rect r2(p, size);
	Rect r3(p, p2);
	Size sos(10, 10);
	Rect r4 = r1 & r2;
	bool eq = (r1 == r2);     //这里的是否相等是严格的相等，不仅仅是面积
	//rotatedrect
	Point2f pf1 = Point2f(0, 0);
	Point2f pf2 = Point2f(10, 0);
	Point2f pf3 = Point2f(6, 10);
	RotatedRect rr2(pf1, pf2, pf3); // 三个点必须构成矩形，否则报错
	RotatedRect rr1(p2, size, 45); // p是中心点，创建数据结构
	//Point2i p_rr = rr1.center;
	//Size p_size = rr1.size;
	//float p_angle = rr1.angle;
	//Point2f pts[4];
	//rr1.points(pts);

	//matx
	Matx33f m(1, 2, 3,
		4, 5, 6,
		7, 8, 9);
	Matx23d m23d = Matx23d::zeros();
	Matx16f m16f = Matx16f::ones();
	Matx33f m33f = Matx33f::eye();
	// 随机阵，还有randn。diag对角阵
	Matx33f randu33f = Matx33f::randu(0, 1);
	double d23 = m23d(1, 2);
	float f16 = m16f(0, 0);
	Matx13f m13f = m33f.row(2);
	Matx22f m22f1(1, 2,
		3, 4);
	Matx22f m22f2(1, 2,
		3, 4);
	Matx22f m22f3 = m22f1 * m22f2;
	Matx22f m22f4 = m22f1.mul(m22f2);
	waitKey();
	return 0;
}
